import { ElMessage } from 'element-plus'

export const updatePopHook = () => {
    const updatePop = (multipleSelection, flag, popTitle, title,disabled,popData) => {
        
        if (multipleSelection.value.length == 1) {
            flag.value = true
            popTitle.value = title
            if(popData.value){
                popData.value = multipleSelection.value[0]
            }
            if(disabled){
                disabled.value = false
            }
        } else {
            ElMessage({
                type: 'warning',
                message: '勾选一个@^@',
            })
        }
    }

    return updatePop
};